# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=tig
pkgver=2.5.9
pkgrel=0
pkgdesc="Text-mode interface for the git revision control system"
url="https://jonas.github.io/tig/"
arch="all"
license="GPL-2.0-or-later"
depends="git"
makedepends="ncurses-dev pcre2-dev"
checkdepends="util-linux-misc"
subpackages="$pkgname-doc"
source="https://github.com/jonas/tig/releases/download/tig-$pkgver/tig-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -O2 -flto=auto" \
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make all
}

check() {
	SHELL=/bin/sh script --return --quiet -c "make -j1 test" /dev/null
}

package() {
	make DESTDIR="$pkgdir" install install-doc-man
}

sha512sums="
fbac05715812c49f1015f1da6999acaa5f994701025a64dc1283d3c8740d4887584d3fd274344c1f7f1638c8e63f938bb699d1d7cc8599d37ad43dcc53da789b  tig-2.5.9.tar.gz
"
